<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" href="mm_lodging1.css" type="text/css" />
    <title>GeoPuebla</title>
<style type="text/css">
<!--
body {
	background-color: #0099CC;
}
.style2 {font-family: Arial, Helvetica, sans-serif}
.style3 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #000000;
	font-weight: bold;
}
.style5 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
-->
  </style>    
    
    <script type="text/javascript" src="pdmarker.js"></script>
    
	<?php 
		include "Global.php";
		GetMap();
	?>

    <script type="text/javascript" src="pdmarker.js"></script>
    
    <script type="text/javascript">
    
    function initialize() 
    {
      if (GBrowserIsCompatible()) 
      {
	    <?php 
	    MapInitialization();
	
		$idEvent= $_POST["event"];
		
		$connection = DBConnect();
	
	
		$query2="select " .
				"e.IDevents idEvent, " .
				"e.Name eventName, " .
				"e.KindOfEvent eventKindOfEvent, " .
				"e.Date eventDate, " .
				"e.Time eventTime, " .
				"e.MoreInfo eventMoreInfo, " .
				"e.Link eventLink, " .
				"p.CoordX CoordX, " .
				"p.CoordY CoordY, " .
				"p.Name placeName, " .
				"p.Adress placeAdress, " .
				"p.Type placeType, " .
				"p.MoreInfo placeMoreInfo, " .
				"p.Image placeImage " .
				"FROM events e, places p " .
				"where e.Place=p.IDplaces " .
				"and e.IDevents=$idEvent"; 
				
				
		$resultado2 = mysql_query($query2) or die ('\n error en query ' . mysql_error());
		
		while($row = mysql_fetch_assoc($resultado2))
		{
			$idEventDB=$row['idEvent'];
			$eventName=$row['eventName'];
			$eventKindOfEvent=$row['eventKindOfEvent'];
			$eventDate=$row['eventDate'];
			$eventTime=$row['eventTime'];
			$eventMoreInfo=$row['eventMoreInfo'];
			$eventLink=$row['eventLink'];
			$CoordX=$row['CoordX'];
			$CoordY=$row['CoordY'];
			$placeName=$row['placeName'];
			$placeAdress=$row['placeAdress'];
			$placeType=$row['placeType'];
			$placeMoreInfo=$row['placeMoreInfo'];
			$placeImage=$row['placeImage'];
			
	
			if( $idEventDB == $idEvent )
			{
				$html="<h1>$placeName</h1>".
						"<img src=img/$placeImage height=300 weight=300 align=center>".
						"<p><b>Adress:</b> $placeAdress</p>".
						"<p>$placeMoreInfo</p>";
		
					echo "marker = new PdMarker(new GLatLng($CoordX, $CoordY));";
					echo "marker.setTooltip('$placeName');";
					echo "marker.setHoverImage('http://www.google.com/mapfiles/dd-start.png');";
					echo "marker.setDetailWinHTML('$html');";
					echo "map.addOverlay(marker);";
				
			}	
		}
		?>

      }
      
    }
	

    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
  	<?php 
		echo "<h1>$eventName</h1>";
		echo "<b>Kind of event</b> : $eventKindOfEvent";
		echo "<br/>";
		echo "<b>Date</b> : $eventDate";
		echo "<br/>";
		echo "<b>Time</b> : $eventTime";
		echo "<br/>";
		echo "<b>More info</b> : $eventMoreInfo";
		echo "<br/>";
		echo "<b>Link</b> : <a href=\"$eventLink\">$eventLink</a>";
		echo "<br/>";
		echo "<br/>";
	?>
    <div id="map_canvas" style="width: 950px; height: 525px" align=center></div>
  </body>
</html>
